package com.ddz.shortcut.utils

import android.util.Log

object JKTextUtils {

    /**
     * .*模糊匹配.*
     * .*模糊匹配1.*|.*模糊匹配2.*
     */
    fun match(regexStr:String?, target:CharSequence?):Boolean{
        if (regexStr.isNullOrBlank()||target.isNullOrBlank()){
            return false
        }
        val regex = Regex(regexStr)
        JKShortcutLog.v("正则匹配") { "${target} === ${regex.find(target)?.groups?.size ?: 0 > 0}" }
        return regex.find(target)?.groups?.size?:0 > 0
    }
}